It's difficult to provide a precise explanation, but in SwiftUI, it's best to follow these two principles:
Avoid changing a view's open/close state simultaneously with other states. Adding a slight delay can help avoid many issues.
Avoid animating states that don't need to be animated.
Post
Replies
Boosts
Views
Activity
func query(group: Group) {
let id = group.id
let predicate = #Predicate<Item> { item in
item.group?.id == id // Compiles
}
}
@MarcusAurelius
This method can indeed compile, but when I use similar code to run, the following error message will appear:
Thread 1: Fatal error: Couldn't find \Tag.id on Tag with fields
May I ask if your code can use the above predicate to fetch data?
Does context.delete mean delete the NSManagedObject instance locally?
So far, this method should indeed work. Still hope Apple will provide a better solution.
So far, I haven't received any response from Apple.
After the previous explanation, I have no more questions about the current behavior of this method. locale is used here to interpolate values for strings as a guide.
Since I've been hoping Apple would provide an API to get the localizedString for a specific locale, for now I can only try to get it via Bundle directly.
Thanks for your reply, it helped me to figure out the use of locale, it seems I had a problem understanding locale in String before.
I used the new Formatter API ParseableFormatStyle and tried to let it be used to specify the text in the output by the following code
let colorString = UIColorFormatStyle().mark().locale(Locale(identifier: "zh-cn")).format(UIColor.blue)
Looks like I need to tweak the string handling a bit.
https://www.fatbobman.com/posts/newFormatter/
same for me , IOS 15 & Monterey with Xcode 13 Beta 4 .